#!/bin/bash



MINGW=i586-mingw32msvc

rm -fr $MINGW
cp -fr /usr/$MINGW .
cd $MINGW

unzip ../win32/atk-dev_1.32.0-2_win32.zip
unzip ../win32/gtk+-dev_2.24.8-1_win32.zip
unzip ../win32/cairo-dev_1.10.2-2_win32.zip
unzip ../win32/libpng-dev_1.4.3-1_win32.zip
unzip ../win32/gettext-runtime-dev_0.18.1.1-2_win32.zip  
unzip ../win32/pango-dev_1.29.4-1_win32.zip
unzip ../win32/glib-dev_2.28.8-1_win32.zip
unzip ../win32/fontconfig-dev_2.8.0-2_win32.zip
unzip ../win32/gdk-pixbuf-dev_2.24.0-1_win32.zip

sed -i "s|^prefix=.*$|prefix=$MINGW|g" lib/pkgconfig/*.pc
cd ./lib
for f in *.lib; 
	do mv $f lib${f%%lib}a; 
done

cp /usr/lib/i386-linux-gnu/pkgconfig/freetype2.pc  pkgconfig/

cd ..


